from selenium.webdriver.common.by import By
from base import Base
class Page(Base):
    #点击搜索框
    def sousuo1(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜商品名称 作者 出版社 ISBN"]')
        ele=self.find_ele(loc)
        return ele
    #搜索框输入内容
    def sousuo2(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    #点击搜索按钮
    def dianjiss(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tvSearch"]')
        ele=self.find_ele(loc)
        return ele
    #点击图片
    def tupian(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.kongfz.app:id/ivPic").instance(6)')
        ele=self.find_ele(loc)
        return ele
    #点击加入购物车按钮
    def gouwuche(self):
        loc=(By.ID,'com.kongfz.app:id/tvAddCart1')
        ele=self.find_ele(loc)
        return ele
    #断言
    def duanyan1(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tv_name" and @text="群山书院"]')
        ele=self.find_ele(loc)
        return ele
